<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>动漫资源管理</title>

    <!-- Bootstrap -->
    <link href="Admin/view/css/bootstrap.min.css" rel="stylesheet">
    <link href="admin/view/css/dashboard.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body background="upload/10082202447e3a23df3e842fe8.jpg">
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">动漫资源管理</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse" aria-expanded="false" style="height: 0.8px;">
          <ul class="nav navbar-nav navbar-right">
            <li><a href="admin.php?c=user&m=logout">注销</a></li>

          </ul>
          <form class="navbar-form navbar-right">
            <input type="text" class="form-control" placeholder="Search...">
          </form>
        </div>
      </div>
    </nav>

    <div class="container">
      <div class="row">
        <!--这里添加代码-->
        <div class="col-sm-3 col-md-2">
          <ul class="nav nav-sidebar">
            <li>
              <a href="admin.php?c=user&m=index">用户管理</a>
              <a href="admin.php?c=user&m=form">添加用户</a>
            </li>
          </ul>
          <ul class="nav nav-sidebar">

            <li>
              <a href="#" data-target="#VT" data-toggle="collapse" class="accordion-toggle" aria-expanded="true">
            动漫类别维护</a>
            
            <ul style="padding-left: 20px;" class="nav collapse in" id="VT" aria-expanded="true">
              <li>
              <a href="admin.php?c=type&m=index">动漫类别管理</a>
            </li>
            <li>
              <a href="admin.php?c=type&m=form">动漫类别添加</a>
            </li>
            </ul></li>
            
          </ul>
          <ul class="nav nav-sidebar">
            <li>
              <a href="admin.php?c=cartoon&m=index">动漫资源管理</a>
            </li>
            <li>
              <a href="admin.php?c=cartoon&m=form">动漫添加</a>
            </li>
          </ul>
          <ul class="nav nav-sidebar">
            <li>
              <a href="admin.php?c=comments&m=index">动漫评论管理</a>
            </li>
            
          </ul>
        </div>
 <h3>查找</h3>
 <table align="center" width="80%">
 <tr><td  align="left" >
 <form method=post action="admin.php?c=user&m=search">
    请输入用户名：
  <input type="text" name="key">
  <input type="submit" name='search' value="搜索">  
 </form> 
 </td></tr>
 </table>

   <div class="col-sm-9 col-md-10">

 <center><h3>用户列表</h3></center>
 <table align="center" width="80%" border=1> 
 <tr>
   <th>用户编号</th>
   <th>用户名</th>   
   <th>性别</th>
   <th>生日</th>
   <th>爱好</th>
   <th>学历</th>
   <th>自我介绍</th> 
   <th width='80'>头像</th>
   <th>操作</th>
 </tr>

 <?php
  foreach (  $data as $row) {
   echo '<tr>';
   echo '<td>'.$row['uid'].'</td>';
   echo '<td>'.$row['uname'].'</td>';  
   echo '<td>'.($row['gender']==0?'男':'女').'</td>';
   echo '<td>'.$row['birthdate'].'</td>';
   echo '<td>'.$row['hobby'].'</td>';
   switch($row['degree']){
     case '1':$dg = "高中";break;
     case '2':$dg = "大学";break;
     case '3':$dg = "研究生";break;
     case '4':$dg = "博士生";break;
     default: $dg="不知道";
     }
   echo '<td>'.$dg.'</td>';
   echo '<td>'.$row['intro'].'</td>';    
    echo '<td align="center"><img src="upload/'.$row['pic'].'" width=60 height=80 alt="无头像"></td>';
   echo '<td><a href="admin.php?c=user&m=mod&id='.$row['uid'].' ">修改</a> | 
   <a href="admin.php?c=user&m=del&id='.$row['uid'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';
   echo '</tr>';  
  }
  echo '</table>';  
  $totalrows = count($data);
  echo "<table align='center'><tr><td>共有{$totalrows}名用户</td></tr></table>";   
 ?>
 
 </table>
 </div>
 </div>
    </div>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="Admin/view/js/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="Admin/view/js/bootstrap.min.js"></script>
  </body>
</html>